package cn.bdqn.dao.questionBank;

import cn.bdqn.dto.questionBank.subject.SubjectDTO;
import cn.bdqn.pojo.questionBank.Subject;
import cn.bdqn.vo.questionBank.subject.SubjectVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;

@Mapper
public interface SubjectDao extends BaseMapper<Subject> {

    /**
     * 根据条件查询题目数据
     * 条件有题目类型和题目的科目类型
     * @return
     */
    List<SubjectVo> selectSubject(@Param("subjectTypeId") Integer subjectTypeId,@Param("accountTypeId") Integer accountTypeId,@Param("status") Integer status);

    /**
     * 批量添加题目
     * @param list
     * @param accountTypeId
     * @return
     */
    Integer insertSubjectList(@Param("list")List<SubjectDTO> list,@Param("accountTypeId")Integer accountTypeId,@Param("operationRecordId") Integer operationRecordId);

    /**
     * 批量删除
     * @param list
     * @return
     */
    Integer deleteListSubject(List<Integer> list);
    /**
     * 批量发布
     * @param list
     * @return
     */
    Integer statusListSubject(List<Integer> list);

    /**
     * 随机获取题目
     * @param size 数量
     * @param accountTypeId 科目类型
     * @param subjectTypeId 题目类型
     * @return
     */
    List<Integer> getSubjectIdList(@Param("accountTypeId") Integer accountTypeId, @Param("subjectTypeId") Integer subjectTypeId,@Param("size") Integer size);

    /**
     *
     * @param subjectTypeId
     * @param accountTypeId
     * @param subjectId
     * @return
     */
    List<Subject> userSelectSubjectList(@Param("subjectTypeId") Integer subjectTypeId, @Param("accountTypeId") Integer accountTypeId, @Param("subjectIdList") List<Integer> subjectId);
}
